$(function(){
    $(".ui-widget-header").css("border", $(".conteudo").css("border"));
    $(".destaque").css("border", $(".ui-widget-content").css("border"));
    //        var cor=($(".ui-widget-content").css("background-color")+$(".ui-widget-header").css("background-color"))/2;
    var cor1 = ($(".ui-widget-content").css("background-color").replace("rgb(","").replace(")","").replace(" ","").replace(", ",",")).split(",");
    var cor2 = ($(".ui-widget-header").css("background-color").replace("rgb(","").replace(")","").replace(" ","").replace(", ",",")).split(",");
    var cor3 = ($(".ui-widget-header").css("background-color"));
    var r=(parseInt(cor1[0])+parseInt(cor2[0]))/2;
    var g=(parseInt(cor1[1])+parseInt(cor2[1]))/2;
    var b=(parseInt(cor1[2])+parseInt(cor2[2]))/2;
    var r2=(parseInt(cor1[0])+parseInt(cor1[0])+r)/3;
    var g2=(parseInt(cor1[1])+parseInt(cor1[1])+g)/3;
    var b2=(parseInt(cor1[2])+parseInt(cor1[2])+b)/3;
    var cor="rgb("+(parseInt(r)+", "+parseInt(g)+", "+parseInt(b))+")";
    var cor2="rgb("+(parseInt(r2)+", "+parseInt(g2)+", "+parseInt(b2))+")";
    $(".destaque").css("background-color", cor2);
    $(".rodape").css("background", $(".ui-widget-header").css("background"));
    $(".ui-widget-header").css("background", $(".ui-widget-header").css("background"));
    $("#nome-empresa").css("background", $(".ui-widget-header").css("background"));
    $("#painel").css("background-color", cor2);
    $(".menu").css("background-color",cor2);
    $(".rootVoices").css("background-color", cor2);
    //        $(".linha1").css("background", $(".ui-widget-content").css("background-color"));
    $(".linha1").css("background-color", cor2);
    $(".linha2").css("background-color", cor);
    $("input[type=submit]").button();
    $("input[type=button]").button();
    $("button").button();
});